﻿<!-- Dark Menu Begin -->
@Styles.Render("~/Content/menu_dark.css")
@*@model IEnumerable<MVC_DaLatServices.Models.Category>*@

<ul class="dark_menu">
    @*.FindAll(c => c.ParentID == null)*@
    @foreach (var item in ((List<MVC_DaLatServices.Models.Category>)ViewData["Menu"]).FindAll(c => c.ParentID == null))
    {
        <li>
            @Html.ActionLink(item.Name, "Index", new { controller = item.Link })
            <ul>
                @* Model.ToList().FindAll(c => c.ParentID == item.ID   =>     List<MVC_DaLatServices.Models.Category>)ViewData["Menu"] *@

                @foreach (var itemChild in ((List<MVC_DaLatServices.Models.Category>)ViewData["Menu"]).FindAll(c => c.ParentID == item.ID))
                {
                    <li>
                        @Html.ActionLink(itemChild.Name, itemChild.Name, new { controller = item.Alias }, new { id = item.Alias })
                    </li>     
                }
            </ul>
        </li>   
    }
</ul>

